<?php
defined('IN_IXDCW') or exit('Access Denied');
$swf_is_admin = defined('DT_ADMIN');
$swf_name = isset($swf_name)?$swf_name:"批量传图";
$swf_from = isset($swf_from)?$swf_from:"photo";
$swf_width = isset($swf_width)?$swf_width:"100";
$swf_height = isset($swf_height)?$swf_height:"100";
$upload_url  = isset($upload_url)?$upload_url:($swf_is_admin ? SITE_URL.'upload.php' : $MODULE[1]['linkurl'].'upload.php');
?>
<tr>
<td class="tl"><?php echo $swf_is_admin ? '<span class="f_hid">*</span> ' : '';?><?php echo $swf_name;?></td> 
<td<?php echo $swf_is_admin ? '' : ' class="tr"';?>>
<link href="<?php echo SITE_URL;?>file/swfupload/style.css" rel="stylesheet" type="text/css"/>
	<div class="swfuploadbtn">
		<span id="spanButtonPlaceholder"></span>
	</div>
<div id="divFileProgressContainer"></div>
<div id="thumbnails"></div>
<script type="text/javascript" src="<?php echo $swf_is_admin ? SITE_URL : $MODULE[1]['linkurl'];?>file/swfupload/swfupload.js"></script>
<script type="text/javascript">var swfu_max = <?php echo $swf_is_admin ? 0 : 20;?>;</script>
<script type="text/javascript" src="<?php echo $swf_is_admin ? SITE_URL : $MODULE[1]['linkurl'];?>file/swfupload/handlers_editor.js"></script>
<script type="text/javascript">
	var swfu;
	//window.onload = function () {
		swfu = new SWFUpload({
			// Backend Settings
			upload_url: "<?php echo $upload_url;?>",
			post_params: {"from": "<?php echo $swf_from;?>", "width": "<?php echo $swf_width;?>", "height": "<?php echo $swf_width;?>", "swf_userid": "<?php echo $_userid;?>", "swf_username": "<?php echo $_username;?>", "swf_groupid": "<?php echo $_groupid;?>", "swf_auth": "<?php echo md5($_userid.$_username.$_groupid.DT_KEY.$DT_IP);?>", "swfupload": "1"},

			// File Upload Settings
			file_size_limit : "32 MB",	// 32MB
			file_types : "*.jpg;*.gif;*.png",
			file_types_description : "Images",
			file_upload_limit : swfu_max,

			// Event Handler Settings - these functions as defined in Handlers.js
			//  The handlers are not part of SWFUpload but are part of my website and control how
			//  my website reacts to the SWFUpload events.
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : uploadSuccess,
			upload_complete_handler : uploadComplete,

			// Button Settings
			button_image_url : "<?php echo $swf_is_admin ? SITE_URL : $MODULE[1]['linkurl'];?>file/swfupload/ico.png",
			button_placeholder_id : "spanButtonPlaceholder",
			button_width: 180,
			button_height: 18,
			button_text : '<span class="button">点击批量上传图片,按Ctrl多选</span>',
			button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
			button_text_top_padding: 0,
			button_text_left_padding: 18,
			button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
			button_cursor: SWFUpload.CURSOR.HAND,
			
			// Flash Settings
			flash_url : "<?php echo $swf_is_admin ? SITE_URL : $MODULE[1]['linkurl'];?>file/swfupload/swfupload.swf",

			custom_settings : {
				upload_target : "divFileProgressContainer"
			},
			
			// Debug Settings
			debug: false
		});
	//};
</script>
</td>
</tr>